package yazan.com.pdacollector_android.model;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import yazan.com.pdacollector_android.model.Goods;
import yazan.com.pdacollector_android.model.OrderInfo;

import yazan.com.pdacollector_android.model.GoodsDao;
import yazan.com.pdacollector_android.model.OrderInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig goodsDaoConfig;
    private final DaoConfig orderInfoDaoConfig;

    private final GoodsDao goodsDao;
    private final OrderInfoDao orderInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        goodsDaoConfig = daoConfigMap.get(GoodsDao.class).clone();
        goodsDaoConfig.initIdentityScope(type);

        orderInfoDaoConfig = daoConfigMap.get(OrderInfoDao.class).clone();
        orderInfoDaoConfig.initIdentityScope(type);

        goodsDao = new GoodsDao(goodsDaoConfig, this);
        orderInfoDao = new OrderInfoDao(orderInfoDaoConfig, this);

        registerDao(Goods.class, goodsDao);
        registerDao(OrderInfo.class, orderInfoDao);
    }
    
    public void clear() {
        goodsDaoConfig.clearIdentityScope();
        orderInfoDaoConfig.clearIdentityScope();
    }

    public GoodsDao getGoodsDao() {
        return goodsDao;
    }

    public OrderInfoDao getOrderInfoDao() {
        return orderInfoDao;
    }

}
